<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //方法一：
      function add(m, n) {
        return m + n
      }
      //方法二
      let sum = (m, n) => m + n

      //方法三：
      let add = function (m, n) {
        return m + n
      }

      //方法四：
      let result = new Function('m', 'n', 'return m+n')

      //方法五:
      function resu() {
        return function (m, n) {
          return m + n
        }
      }

      //方法六：

      function result2([m, n]) {
        return m + n
      }
    </script>
  </body>
</html>
